<template>
  <div class="block">
    <el-carousel height="200px" interval=5000>
      <el-carousel-item v-for="item in imglist" :key="item">
        <img :src="item.url" alt="lunbo" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style>
.el-carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>

<script>
export default {
  data() {
    return {
      imglist: [
        {
          url:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1598378226421&di=f9c364861197c2518833ca3dc420c339&imgtype=0&src=http%3A%2F%2Fimg.yanj.cn%2Fstore%2Fgoods%2F7833%2F7833_c1429b44ea5c8af1a1b88857382a840c.png",
        },
        {
          url:
            "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2406608946,3158722286&fm=26&gp=0.jpg",
        },
        {
          url:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1598378304533&di=f797482b9cad499123db2fc4d5a04153&imgtype=0&src=http%3A%2F%2Fstatic001.infoq.cn%2Fresource%2Fimage%2Fc4%2F01%2Fc4251ee38c2039602d69cac1d3ab9d01.jpg",
        },
      ],
    };
  },
};
</script>